# -*- coding: utf-8 -*-
import wx
import os
from wxPython.wx import *

class CLS_View_File_Chooser():

	''' Class File Chooser -> Escolher XLS '''

	def __init__(self):

		''' INIT -> File path, name'''

		self.file_path = ''
		self.file_name = ''
		
	def chooseFile(self):
		
		''' Dialog -> Escolher XLS '''

		wildcard = "Exel source (*.xls)|*.xls|"
		dialog_choose_file = wx.FileDialog(None, "Escolher ficheiro Xls", os.getcwd(), "", wildcard, wx.OPEN)		
		if dialog_choose_file.ShowModal() == wxID_OK:
			self.file_path = dialog_choose_file.GetPath()
			self.file_name = dialog_choose_file.GetFilename()
			return self.file_path
		else:
			dialog_choose_file.Destroy()
			return None
			
	def get_file_path(self):
		
		''' Get File Path -> Return caminho completo do ficheiro '''

		return self.file_path

	def get_file_name(self):
		
		''' Get File Name -> Return nome do ficheiro'''
		
		return self.file_name
